import adminSupport from 'lola-admin-support-el'
const service = adminSupport.lib.service
// ---------------------------------运输数据----------------------------------------

// 物流业务统计
export function logisticsData(data) {
  // console.log(data)
  const url = service.conf.api.get('wms').url + '/api/logistics/index/findAllData'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.get(url, data))
  })
  return promise
}

// 运输单处理事务
export function logisticsTransactions(data) {
  const url = service.conf.api.get('wms').url + '/api/logistics/index/findOrderStatusData'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}

// 运输业务图表统计数据
export function logisticsEchartData(data) {
  const url = service.conf.api.get('wms').url + '/api/logistics/index/findBiData'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.get(url, data))
  })
  return promise
}
// ------------------------------------采购数据-----------------------------------------------

// 采购日报查询
export function purchaseBiDay(data) {
  const url = service.conf.api.get('bi').url + '/api/report/pur/report/purchase/day'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}

// 采购月报查询
export function purchaseBiMonth(data) {
  const url = service.conf.api.get('bi').url + '/api/report/pur/report/purchase/month'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}
// 采购年报查询
export function purchaseBiYear(data) {
  const url = service.conf.api.get('bi').url + '/api/report/pur/report/purchase/year'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}
// 采购待处理业务
export function purchaseTransaction(data) {
  const url = service.conf.api.get('bi').url + '/api/report/pur/work/employee'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}

// 采购指定期间员工统计
export function purchaseViewData(data) {
  const url = service.conf.api.get('bi').url + '/api/report/pur/statistics/employee'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url, data))
  })
  return promise
}

// 客服系统首页概览
export function customerServiceOverdata() {
  const url = service.conf.api.get('wms').url + '/api/service/index/countNumber'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url))
  })
  return promise
}

// 客服系统事务中心
export function customerServiceTransactionNumber() {
  const url = service.conf.api.get('wms').url + '/api/service/index/transactionNumber'
  const promise = new Promise(function(resolve, reject) {
    resolve(service.post(url))
  })
  return promise
}

// module.exports = {
//   logisticsData,
//   logisticsTransactions,
//   logisticsEchartData,
//   purchaseBiDay,
//   purchaseBiMonth,
//   purchaseBiYear,
//   purchaseTransaction,
//   purchaseViewData
// }
